package org.ishequ.utils;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;

public class StreamTools {

	public static byte[] read(InputStream is) throws IOException {
		ByteArrayOutputStream bis = new ByteArrayOutputStream();
		byte[] buffer = new byte[1024];
		int len = 0;
		while((len = is.read(buffer)) != -1){
			bis.write(buffer, 0, len);
		}
		return bis.toByteArray();
	}
	
}
